import { fromJS } from "immutable";
import * as actionTypes from "./actionTypes";

const defaultState = fromJS({
    loginStatus: false
});

export default (state = defaultState, action) => {
    if (action.type === actionTypes.CHANGE_LOGIN) {
        return state.set("loginStatus", action.value);
    }

    if (action.type === actionTypes.LOGOUT) {
        return state.set("loginStatus", action.value);
    }

    return state;
};
